<?php
// 清除所有Session文件
$sessionPath = __DIR__ . '/runtime/session';

echo "=== 清除所有Session ===\n\n";

if (is_dir($sessionPath)) {
    $files = glob($sessionPath . '/*');
    $count = 0;
    
    foreach ($files as $file) {
        if (is_file($file)) {
            unlink($file);
            $count++;
        }
    }
    
    echo "✓ 已删除 {$count} 个Session文件\n";
} else {
    echo "✗ Session目录不存在\n";
}

// 清除缓存
$cachePath = __DIR__ . '/runtime/cache';
if (is_dir($cachePath)) {
    $dirs = glob($cachePath . '/*');
    $count = 0;
    
    foreach ($dirs as $dir) {
        if (is_dir($dir)) {
            $files = glob($dir . '/*');
            foreach ($files as $file) {
                if (is_file($file)) {
                    unlink($file);
                    $count++;
                }
            }
        }
    }
    
    echo "✓ 已删除 {$count} 个缓存文件\n";
}

echo "\n✅ 清理完成！\n";
echo "\n现在请：\n";
echo "1. 关闭浏览器\n";
echo "2. 重新打开浏览器\n";
echo "3. 访问 http://127.0.0.1:8000\n";
echo "4. 登录 (admin / admin)\n";

